#include <cstdlib>
#include <iostream>

using namespace std;

// Rectangle class declaration.
class Cube {
	private:
		double width;
		double length;
		double height;

	public:
		Cube();
		~Cube();

		void setWidth (double);
		void setLength (double);
		void setHeight (double);

		double getWidth();
		double getLength();
		double getHeight();
		double getArea();
};
// Class constructor -
Cube::Cube() {
	// Set defaults
	length = 1;
	width = 1;
	height = 1;
}

Cube::~Cube() {
}

//setWidth assigns a vaule to the width member.

void Cube::setWidth(double w) {
	width = w;
}

//setLength assigns a value to the length member.

void Cube::setLength(double len) {
	length = len;
}

void Cube::setHeight(double h) {
	height = h;
}

//getWidth returns the valuue in the width member.

double Cube::getWidth() {
	return width;
}

//getLength returns the value in the length member.

double Cube::getLength() {
	return length;
}

double Cube::getHeight() {
	return height;
}

//getArea returns the product of width times length.

double Cube::getArea() {
	return length * width * height;
}


int main() {
    Cube box; // Define an instance of the Rectangle  class
    double rectWidth; //Local variable for width
    double rectLength; //Local variable for length
	double rectHeight; //Local variable for height

    //Get the rectangle's width and length from the user.
    cout << "This program will calculate the area of a\n";

	cout << "What is the length? ";
    cin >> rectLength;

    cout << "What is the width? ";
    cin >> rectWidth;

	cout << "What is the height? ";
    cin >> rectHeight;
	cin.ignore();

    //Store the width and length of the rectangle
    //in the box object.
    box.setWidth (rectWidth);
    box.setLength (rectLength);
    box.setHeight (rectHeight);

    //Display the rectangle's data.
    cout << "\nHere is the rectangle's data:\n";
	cout << "Length: " << box.getLength() << endl;
    cout << "Width: " << box.getWidth() << endl;
    cout << "Height: " << box.getHeight() << endl;
    cout<< "Area: " << box.getArea() << endl;
    cin.get();
    return 0;
}
